/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.ipti.br.tag.bo;

import org.ipti.br.tag.dao.ActivityFacade;
import org.ipti.br.tag.entity.Activity;
import org.ipti.br.tag.entity.UnitySchedule;
import org.ipti.br.tag.entity.WorkTopic;
import java.util.Calendar;
import java.util.List;
import javax.ejb.Stateless;
import javax.inject.Inject;

/**
 *
 * @author luancorumba
 */
@Stateless
public class ActivityBO {
    
    @Inject
    private ActivityFacade activityFacade;
    
    public void create(Activity activity) {
        activityFacade.create(activity);
    }
    
    public void create(Calendar day, UnitySchedule us, WorkTopic topic) {
        activityFacade.create(new Activity(day, us, topic));
    }
    
    public void remove(Activity activity) {
        activityFacade.remove(activity);
    }
    
    public List<Activity> list(Calendar day, UnitySchedule unitySchedule) {
        day.set(Calendar.HOUR_OF_DAY, 0);
        day.set(Calendar.MINUTE, 0);
        day.set(Calendar.SECOND, 0);
        
        return activityFacade.list(day, unitySchedule);
    }
}
